package com.java.exer_6;

import javax.swing.*;
import java.util.List;

public class FreeProsEvent implements Event {
    private static final int FREE_PRO_COUNT = 5;

    @Override
    public void event(Player player, List<Product> marketProList) {
        JOptionPane.showMessageDialog(null, "遇到老乡，偷偷塞该我" + FREE_PRO_COUNT + "包摇头丸");
        Product product = XianLiveMain.getProList().get(11);
        //设定当前价格为0
        product.setNowPrice(0);
        //添加到玩家货物列表
        player.buyPro(product, FREE_PRO_COUNT);
    }
}
